package com.wei.miaosha.service;

import com.wei.miaosha.dao.UserDao;
import com.wei.miaosha.domain.User;
import com.wei.miaosha.vo.LoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.beans.Transient;

/**
 * Created by Weizichen on 2018/8/4.
 * desc:用户业务层
 */
@Service
public class UserService {
    @Autowired
    UserDao userDao;

    public User getById(int id) {
        return userDao.getById(id);
    }

    @Transactional
    public boolean tx() {
        User u1 = new User(2, "家狗");
        userDao.insert(u1);
        User u2 = new User(1, "家狗子");
        userDao.insert(u2);
        return true;
    }


}
